/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Hnmtuan
 */
@Embeddable
public class OrderdetailPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "Order")
    private String order;
    @Basic(optional = false)
    @Column(name = "ItemCode")
    private String itemCode;
    @Basic(optional = false)
    @Column(name = "CateCode")
    private String cateCode;

    public OrderdetailPK() {
    }

    public OrderdetailPK(String order, String itemCode, String cateCode) {
        this.order = order;
        this.itemCode = itemCode;
        this.cateCode = cateCode;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getCateCode() {
        return cateCode;
    }

    public void setCateCode(String cateCode) {
        this.cateCode = cateCode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (order != null ? order.hashCode() : 0);
        hash += (itemCode != null ? itemCode.hashCode() : 0);
        hash += (cateCode != null ? cateCode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderdetailPK)) {
            return false;
        }
        OrderdetailPK other = (OrderdetailPK) object;
        if ((this.order == null && other.order != null) || (this.order != null && !this.order.equals(other.order))) {
            return false;
        }
        if ((this.itemCode == null && other.itemCode != null) || (this.itemCode != null && !this.itemCode.equals(other.itemCode))) {
            return false;
        }
        if ((this.cateCode == null && other.cateCode != null) || (this.cateCode != null && !this.cateCode.equals(other.cateCode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.OrderdetailPK[order=" + order + ", itemCode=" + itemCode + ", cateCode=" + cateCode + "]";
    }

}
